package com.vishnu.plugin;

public class SingleTonDesignPattern {

	private static Object sessionFatory=null;
	
	static{
		SampleJavaBean sjb=new SampleJavaBean();
		sessionFatory=sjb;
		
	}
	
	public static Object getSessionFactory(){

		return sessionFatory;
	}
	
	
	public static void main(String[] args) {
		
		SingleTonDesignPattern stdp=new SingleTonDesignPattern();
		System.out.println(stdp.getSessionFactory());
		System.out.println(SingleTonDesignPattern.sessionFatory);
		System.out.println(SingleTonDesignPattern.getSessionFactory());
		System.out.println(SingleTonDesignPattern.getSessionFactory());
		System.out.println(SingleTonDesignPattern.getSessionFactory());
		SingleTonDesignPattern.sessionFatory="saa";
		System.out.println(SingleTonDesignPattern.getSessionFactory());
		
		
		System.out.println(stdp.getSessionFactory());
		
	}
}
